package gtkwire.widget.cairo;

/**
* Super class for gradient color patterns. Contains functionality for setting color stops for gradients.
*/
public abstract class CairoGradientPattern extends CairoPattern
{
	protected CairoGradientPattern()
	{
		super();
	}

	/**
	*Adds an opaque color stop to a gradient pattern. Possible alpha value of the color is discarded.
	* The offset specifies the location along the gradient's control vector. 
	*For example, a linear gradient's control vector is from (x0,y0) to (x1,y1) 
	*while a radial gradient's control vector is from any point on the start circle to the corresponding point on the end circle.
	*<p>
	*If two (or more) stops are specified with identical offset values, 
	*they will be sorted according to the order in which the stops are added, 
	*(stops added earlier will compare less than stops added later). 
	*This can be useful for reliably making sharp color transitions instead of the typical blend.
	*/
	public void add_color_stop_rgb(  double offset, CairoColor c )
	{
		p_add_color_stop_rgb( pattern_id, offset, c.getRed(), c.getGreen(), c.getBlue() );
	}

	/**
	*Adds a translucent color stop to a gradient pattern.
	* The offset specifies the location along the gradient's control vector. 
	*For example, a linear gradient's control vector is from (x0,y0) to (x1,y1) 
	*while a radial gradient's control vector is from any point on the start circle to the corresponding point on the end circle.
	*<p>
	*If two (or more) stops are specified with identical offset values, 
	*they will be sorted according to the order in which the stops are added, 
	*(stops added earlier will compare less than stops added later). 
	*This can be useful for reliably making sharp color transitions instead of the typical blend.
	*/
	public void add_color_stop_rgba(  double offset, CairoColor c )
	{
		p_add_color_stop_rgba( pattern_id, offset, c.getRed(), c.getGreen(), c.getBlue(), c.getAlpha() );
	}

}//end class